package com.wqtz.chechai.view.activities;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.wqtz.chechai.R;
import com.wqtz.chechai.base.BaseActivity;
import com.wqtz.chechai.presenter.BasePresent;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2017/1/22 16:47
 */

public class CarInfoDetailActivity extends BaseActivity {
	@BindView(R.id.iv_back)
	ImageView mIvBack;
	@BindView(R.id.tv_title)
	TextView mTvTitle;
	@BindView(R.id.rl_title)
	RelativeLayout mRlTitle;
	@BindView(R.id.tv_car_vin)
	TextView mTvCarVin;
	@BindView(R.id.ll_car_vin)
	LinearLayout mLlCarVin;
	@BindView(R.id.tv_brand)
	TextView mTvBrand;
	@BindView(R.id.ll_car_brand)
	LinearLayout mLlCarBrand;
	@BindView(R.id.tv_model)
	TextView mTvModel;
	@BindView(R.id.ll_car_model)
	LinearLayout mLlCarModel;
	@BindView(R.id.tv_car_version)
	TextView mTvCarVersion;
	@BindView(R.id.ll_car_version)
	LinearLayout mLlCarVersion;
	@BindView(R.id.tv_car_pai)
	TextView mTvCarPai;
	@BindView(R.id.ll_car_pai)
	LinearLayout mLlCarPai;
	@BindView(R.id.tv_car_new_price)
	TextView mTvCarNewPrice;
	@BindView(R.id.ll_car_new_price)
	LinearLayout mLlCarNewPrice;
	private String carVIN;//车辆VIN码
	private String carModel;//车辆型号
	private String price2;//经销商购入价
	private String[] carinfo;


	@Override
	public void init() {
		ButterKnife.bind(this);
		Intent intent = getIntent();
		carModel = intent.getStringExtra("carModel");
		price2 = intent.getStringExtra("price2");
		carVIN = intent.getStringExtra("VIN");

	}

	@Override
	public void loadData() {
		carinfo = carModel.split(" ");
		mTvCarVin.setText(carVIN);
		mTvBrand.setText(carinfo[1]);
		mTvModel.setText(carinfo[2]);
		mTvCarVersion.setText(carinfo[3]);
		mTvCarNewPrice.setText(price2+"万");
	}

	@Override
	public int setContentViews() {
		return R.layout.activity_carinfoderail;
	}

	@Override
	public BasePresent createPresenter() {
		return null;
	}



	@OnClick(R.id.iv_back)
	public void onClick() {
		finish();
	}
	@Override
	protected void onResume() {
		super.onResume();
		activitys.add(this); //添加当前的activity
	}
}
